package com.androidx.p013lv.mine.activity;

import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import com.androidx.p013lv.base.p015ui.BaseActivity;
import com.androidx.p013lv.mine.C1207R;
import com.androidx.p013lv.mine.databinding.ActivityMineAttentionLayoutBinding;
import com.androidx.p013lv.mine.fragment.AboutHerAttentionFragment;
import com.androidx.p013lv.mine.fragment.MineAttentionFragment;
import com.androidx.p013lv.mine.novel.fragment.MineAttentionNovelFragment;
import com.google.android.material.tabs.TabLayout;
import com.gyf.immersionbar.ImmersionBar;

/* renamed from: com.androidx.lv.mine.activity.MineAttentionActivity */
public class MineAttentionActivity extends BaseActivity<ActivityMineAttentionLayoutBinding> {
    /* access modifiers changed from: protected */
    @Override // com.androidx.p013lv.base.p015ui.BaseActivity
    public void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this).titleBar(((ActivityMineAttentionLayoutBinding) this.binding).toolbar).statusBarDarkFont(false).init();
    }

    @Override // com.androidx.p013lv.base.p015ui.BaseActivity
    public int setLayout() {
        return C1207R.C1212layout.activity_mine_attention_layout;
    }

    /* access modifiers changed from: protected */
    @Override // com.androidx.p013lv.base.p015ui.BaseActivity
    public void initView() {
        super.initView();
        ((ActivityMineAttentionLayoutBinding) this.binding).setClick(new OnClick());
        ((ActivityMineAttentionLayoutBinding) this.binding).viewPager.setAdapter(new Adapter(getSupportFragmentManager()));
        ((ActivityMineAttentionLayoutBinding) this.binding).tabLayout.addOnTabSelectedListener((TabLayout.OnTabSelectedListener) new TabLayout.OnTabSelectedListener() {
            /* class com.androidx.p013lv.mine.activity.MineAttentionActivity.C12471 */

            @Override // com.google.android.material.tabs.TabLayout.BaseOnTabSelectedListener
            public void onTabReselected(TabLayout.Tab tab) {
            }

            @Override // com.google.android.material.tabs.TabLayout.BaseOnTabSelectedListener
            public void onTabSelected(TabLayout.Tab tab) {
                MineAttentionActivity.this.changeTabTextView(tab, true);
            }

            @Override // com.google.android.material.tabs.TabLayout.BaseOnTabSelectedListener
            public void onTabUnselected(TabLayout.Tab tab) {
                MineAttentionActivity.this.changeTabTextView(tab, false);
            }
        });
        ((ActivityMineAttentionLayoutBinding) this.binding).tabLayout.setupWithViewPager(((ActivityMineAttentionLayoutBinding) this.binding).viewPager);
    }

    public void changeTabTextView(TabLayout.Tab tab, boolean z) {
        if (tab.getCustomView() == null) {
            tab.setCustomView(C1207R.C1212layout.attention_tab_layout_text);
        }
        TextView textView = (TextView) tab.getCustomView().findViewById(16908308);
        if (z) {
            textView.setTextAppearance(getActivity(), C1207R.C1214style.TabLayoutAttentionTextSize);
        } else {
            textView.setTextAppearance(getActivity(), C1207R.C1214style.TabLayoutNormalAttentionTextSize);
        }
    }

    /* renamed from: com.androidx.lv.mine.activity.MineAttentionActivity$OnClick */
    public class OnClick {
        public OnClick() {
        }

        public void btnBack() {
            MineAttentionActivity.this.finish();
        }
    }

    /* renamed from: com.androidx.lv.mine.activity.MineAttentionActivity$Adapter */
    public static class Adapter extends FragmentStatePagerAdapter {
        @Override // androidx.viewpager.widget.PagerAdapter
        public int getCount() {
            return 3;
        }

        @Override // androidx.viewpager.widget.PagerAdapter
        public CharSequence getPageTitle(int i) {
            return i == 0 ? "綜合" : i == 1 ? "约吧" : "主播";
        }

        Adapter(FragmentManager fragmentManager) {
            super(fragmentManager, 1);
        }

        @Override // androidx.fragment.app.FragmentStatePagerAdapter
        public Fragment getItem(int i) {
            if (i == 0) {
                return MineAttentionFragment.newInstance();
            }
            if (i == 1) {
                return AboutHerAttentionFragment.newInstance();
            }
            return MineAttentionNovelFragment.newInstance();
        }
    }
}
